from SimpylScrape.Parsers import SiteParser, XpathParser, ZipParser
from SimpylScrape.ParseDecorators import Filter
import SimpylScrape.ParseUtils as Utils

class Passwird(SiteParser):
    """
    http://www.passwird.com
    """
    class Entries(XpathParser):
        """
        .//div[@id='content']
        """
        class Entry(ZipParser):
            """
            This will zip the attributes together
            """
            @Filter(func=lambda x: len(x) > 15)
            def title(text):
                """
                ./span/text()
                """
                return text
            body = ("./div/span/..", Utils.text)
            image = ("./div/img/@src", Utils.text)
            link = ("./div/span/b/a/@href", Utils.text)
